﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.WebUI.Controllers
{
    public class VoteController : ApiController
    {
        private readonly VoteManage _bll = PolicyInjection.Create<VoteManage>();
        [HttpGet]
        public Model.Vote ShowVote(int? id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id参数不能为空。");
            }
            return this._bll.ShowVote(id.Value);
        }

        // POST api/<controller>
        public Result Post(Model.Vote info)
        {
            return this._bll.PostVote(info);
        }
    }
}